package com.hibiscusking.org.service.impl;

import com.hibiscusking.basic.util.PageList;
import com.hibiscusking.org.domain.SystemDictionaryDetail;
import com.hibiscusking.org.domain.SystemDictionaryType;
import com.hibiscusking.org.mapper.SystemDictionaryDetailMapper;
import com.hibiscusking.org.query.SystemDictionaryDetailQuery;
import com.hibiscusking.org.service.SystemDictionaryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SystemDictionaryDetailServiceImpl implements SystemDictionaryDetailService {
    @Autowired
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;

    @Override
    public List<SystemDictionaryDetail> findAll() {
        return null;
    }

    @Override
    public void add(SystemDictionaryDetail systemDictionaryDetail) {
        systemDictionaryDetailMapper.add(systemDictionaryDetail);
    }

    @Override
    public void dele(Long id) {
        systemDictionaryDetailMapper.dele(id);
    }

    @Override
    public void update(SystemDictionaryDetail systemDictionaryDetail) {
        systemDictionaryDetailMapper.update(systemDictionaryDetail);
    }

    @Override
    public PageList<SystemDictionaryDetail> findQuerySystemDictionaryDetail(SystemDictionaryDetailQuery query) {
        Integer detailNumber = systemDictionaryDetailMapper.findDetailNumber(query);
        if (detailNumber == 0 || detailNumber == null) {
            return new PageList<>();
        }
        List<SystemDictionaryDetail> detail = systemDictionaryDetailMapper.findQuerySystemDictionaryDetail(query);
        return new PageList<>(detailNumber,detail);
    }

    @Override
    public Integer findDetailNumber(SystemDictionaryDetailQuery query) {
        return null;
    }

    @Override
    public void batchdele(List<Long> ids) {
        systemDictionaryDetailMapper.batchdele(ids);
    }

    @Override
    public List<SystemDictionaryDetail> findAllDetailById(Long id) {
        return systemDictionaryDetailMapper.findAllDetailById(id);
    }

    @Override
    public void deleByTypsId(Long id) {
        systemDictionaryDetailMapper.deleByTypsId(id);
    }
}
